www.gusucode.com > 循环自相关函数工具箱源码程序 > matlab代做 修改 程序循环自相关函数工具箱/cyclostationary_toolbox/strip_spectral_correlation.m

    function S=strip_spectral_correlation(x,y,N,a,g)
%
% STRIP_SPECTRAL_CORRELATION
%              estimate the spectral correlation density using the strip
%              spectral correlation
%              N.B. Produces a skewed SCDF in S whith axes
%                   f+alpha/2, alpha 
% 
%              Reference:
%              Roberts R. S., Brown, W. A. and Loomis, H. H.
%              "Computationally efficient algorithms for cyclic
%              spectral analysis" IEEE Signal Processing Magazine
%              8(2) pp38-49 April 1991
%
%              Input parameters are:
%              x,y signals
%              N   length of time window used for estimating frequency 
%                  segments (should be power of 2)
%              a   window used for smoothing segments
%              g   window for smoothing correlation
%                           
% USAGE        S=strip_spectral_correlation(x,y,N,a,g)
%
%              e.g s=strip_spectral_correlation(s1,s1,64,'hamming','hamming')

lx=length(x);
ly=length(y);

ln=lx-N;
if (ln~=ly)
  warning('Length y is not Length x+N, some data will not be used')
end

a=feval(a,N)';
g=feval(g,ln)';
g=g/sum(g);
a=a/sum(a);

X=zeros(N,ln);

for i=1:ln
  n_r=(1:N)+i-1;
  X(:,i)=fftshift(fft(a.*x(n_r)))';	
end

l=min([ly ln]);

S=zeros(N,ln);
for f=1:N
   S(2*f,:)=fftshift(fft(g.*X(f,1:l).*y(1:l)));
end